package com.hello.controller;

import com.hello.common.result.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hello.common.constant.ResultCode;

import java.util.HashMap;
import java.util.Map;


@RestController
@RequestMapping("/dev-api/user")
public class UserController {

    @RequestMapping("/login")
    public Result aa() {
        Map user = new HashMap();
        user.put("token", "admin-token");
        return Result.success(user);
    }

    @RequestMapping("/info")
    //{"code":20000,"data":{"roles":["admin"],"introduction":"I am a super administrator","avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif","name":"Super Admin"}}
    public Result bb() {
        Map res = new HashMap();
        String[] aa = {"admin"};
        res.put("roles", aa);
        res.put("introduction", "I am a super administrator");
        res.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        res.put("name", "Super Admin");
        return Result.success(res);
    }

    @RequestMapping("/logout")
    //{"code":20000,"data":{"roles":["admin"],"introduction":"I am a super administrator","avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif","name":"Super Admin"}}
    public Result cc() {

        return Result.success();
    }
}
